<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page session="false"%>
<%@ page pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>后台管理</title>
  <link href="<c:url value="/resources/easyui/themes/icon.css" />" rel="stylesheet" type="text/css" />
  <link href="<c:url value="/resources/easyui/themes/default/easyui.css" />" rel="stylesheet" type="text/css" />
  
  <script src="<c:url value="/resources/easyui/jquery-1.7.1.min.js" />"></script>
  <script src="<c:url value="/resources/easyui/jquery.easyui.min.js" />"></script>
  <script type="text/javascript" src="<c:url value="/resources/easyui/locale/easyui-lang-zh_CN.js" />"></script>
</head>
<style>
  .header{
	background:url(<c:url value="/resources/images/admin/topback.gif"/>) repeat-x;
	background1:#A1C4E4;
	height:60px;
	width:100%;
  }
</style>
<script>
		
		function addTab(tab){
			var tabObject = getSelected(tab);
			if(tabObject){
				//selected existing tab
				$('#tabContainer').tabs('close',tab);
			}
				//create new tab
				//alert('1111111');
				
				var url = '';
				if(tab=='企业会员'){
				  url='<c:url value="/admin/member/enterpriseUser" />';
				}else if(tab=='个人会员'){
				  url='<c:url value="/admin/member/personalUser" />';
				}else if(tab=='系统管理员'){
				  url='<c:url value="/admin/member/systemUser" />';
				}else if(tab=='媒体类别'){
				  url='<c:url value="/admin/category/list?id=100" />';
				}else if(tab=='媒体供应'){
				  url='<c:url value="/admin/product/query" />';
			    }else if(tab=='重建系统数据'){
				  url='<c:url value="/admin/search/preUpdateIndex" />';
			    }else if(tab=='重建静态化页面'){
				  url='<c:url value="/admin/product/preStaticize" />';
			    }else if(tab=='更新地域菜单'){
				  url='<c:url value="/admin/region/preStaticize" />';
			    }else if(tab=='更新媒体类别菜单'){
				  url='<c:url value="/admin/category/preStaticize" />';
			    }else{
				  alert('To be continued...');
				}
				//alert('URL111:'+url);
				
				var tabContent = '<iframe id="'+tab+'" name="'+tab+'" src="'+url+'" width="95%" height="95%" frameborder="0" scrolling="auto"></iframe>';

				//alert('tabContent:'+tabContent);
				$('#tabContainer').tabs('add', {
					title: tab,
					content: tabContent,
					closable:true
				});
				//alert('222222222222');
				
				//var url = '<c:url value="/admin/member/query?type=person&page=1&pageSize=10" />';
				//alert('URL:'+url);
				
		}
		
		function getSelected(tab){
			var tab = $('#tabContainer').tabs('getTab', tab);
			return tab;
		}

		/*
		*刷新时间
		*/
		function showTime(){
			var date=new Date();
			$('#timeInfo').html();
			$('#timeInfo').html('欢迎你，<%=request.getParameter("name") %>&nbsp;&nbsp;&nbsp;&nbsp;'+date.toLocaleString()+"&nbsp;&nbsp;");
		}
		setInterval(showTime,1000);

		function gotoLoginPage(){
			document.location.href = '<c:url value="/admin/logout" />';
		}
	</script>
	
<body class="easyui-layout" onload="showTime()">

	<div region="north" style="height:65px;width: 100%;">
		<div class="header">
				<div style="text-align:right;padding-right: 20px;padding-top: 22px;">
					<span style="color:#ddd" id="timeInfo"></span>
					<a href="javascript:void(0)" onclick="javascript:gotoLoginPage()" style="color:#fff;text-decoration:none;">退出</a>
				</div>
				<div style="top: 12;">后台管理系统</div>
		</div>
	</div>
	<div region="south" style="height: 35px;">
			<center>
	    		<span>联系我们　 |　 法律声明　 |　合作伙伴　|　客户服务　|　隐私声明</span><br>
	    		<span>运营商：上海宏深网络科技有限公司 Copyright © 2001-2010 All Right Reserved &nbsp;&nbsp; 沪ICP备11011732号-2</span>
	    	</center>
	</div>
	
	<div region="west" split="true" title="导航菜单栏" style="width:280px;padding1:10px;overflow:hidden;">
		<div class="easyui-accordion" fit="true" border="false">
			
			<div title="&nbsp;&nbsp;会员管理" style="padding:10px;">
				<a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('企业会员')">企业会员</a><br/>
				<a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('个人会员')">个人会员</a><br/>
			</div>
			
			<div title="&nbsp;&nbsp;媒体产品管理"  style="padding:10px;">
				<a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('媒体供应')">媒体供应</a><br/>
				<a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('媒体求购')">媒体求购</a><br/>
			</div>
			<div title="&nbsp;&nbsp;系统管理" style="padding:10px">
			    <a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('重建系统数据')">重建系统数据</a><br/>
			    <a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('重建静态化页面')">重建静态化页面</a><br/>
			    <a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('更新地域菜单')">更新地域菜单</a><br/>
			    <a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('更新媒体类别菜单')">更新媒体类别菜单</a><br/>
				<a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('媒体类别')">管理媒体属性</a><br/>
				<a class="easyui-linkbutton" href="javascript:void(0)" onclick="javascript:addTab('系统管理员')">添加系统管理员</a><br/>
			</div>
		</div>
	</div>
	
	<div region="center" style="overflow:hidden;">
		<div id="tabContainer" class="easyui-tabs" fit="true" border="false">
			
			<div  title="主页" style="padding:20px;overflow:hidden;"> 
				<div style="margin-top:20px;">
					<h3>欢迎来到QMT580管理平台</h3>
				</div>	
			</div>
			
			
			</div>
		</div>
	</div>
</body>
</html>